﻿namespace TimeTable.Domain.Entity
{
    public class StudyUnit
    {
        public int ID { get; set; }
        public string Name { get; set; }
        public int StudentsNumber { get; set; }
        public Division Division { get; set; }
        public StudyUnit Parent { get; set; }
        public StudyUnitType Type { get; set; }

        public override string ToString()
        {
            if (Type == StudyUnitType.Group)
            {
                return string.Format("{0} / {1} / {2} ({3} students)", Name, Parent.Name, Division, StudentsNumber);
            }

            return string.Format("{0} / {1} ({2} students)", Name, Division, StudentsNumber);
        }
    }
}
